package com.uuah.server.context.notification;

import com.uuah.server.api.context.notification.linstener.IServerNotificationListener;

/**
 *
 * TODO comment ...
 *
 * <p>
 * update record:updator，update time，update content and version
 * </p>
 *
 * @author <a href="jonny_quan@hotmail.com">jonny</a>
 * @date 2009 2009-3-27 下午01:33:49
 * @version 1.0.0
 */
public class ListenerSubscriptionPair {

	private IServerNotificationListener listener;
	private String subscription = ServerNotificationManager.NULL_SUBSCRIPTION;
	private boolean nullSubscription = true;

	public ListenerSubscriptionPair() {
	}

	public ListenerSubscriptionPair(IServerNotificationListener listener) {
		setListener(listener);
	}

	public ListenerSubscriptionPair(IServerNotificationListener listener,
			String subscription) {
		setListener(listener);
		setSubscription(subscription);
	}

	public void setListener(IServerNotificationListener listener) {
		this.listener = listener;
	}

	public void setSubscription(String subscription) {
		if (null != subscription) {
			this.subscription = subscription;
			nullSubscription = false;
		}
	}

	public IServerNotificationListener getListener() {
		return listener;
	}

	public String getSubscription() {
		return subscription;
	}

	public boolean isNullSubscription() {
		return nullSubscription;
	}

}
